home *** CD-ROM | disk | FTP | other *** search
/ Amiga Desktop Video CD / Amiga DeskTop Video CD.iso / install / forceicon / source / forceicon.h < prev    next >
Text File  |  1994-06-23  |  13KB  |  324 lines

  1. /*
  2. Auto:        smake ForceIcon
  3. */
  4.  
  5.  
  6. /* $Revision Header built automatically *************** (do not edit) ************
  7. **
  8. ** © Copyright by GuntherSoft
  9. **
  10. ** File             : SnakeSYS:CPrgs/Utils/ForceIcon/ForceIcon.h
  11. ** Created on       : Wednesday, 20.10.93 17:19:27
  12. ** Created by       : Kai Iske
  13. ** Current revision : V1.4
  14. **
  15. **
  16. ** Purpose
  17. ** -------
  18. **   - ForceIcon Header file
  19. **
  20. ** Revision V1.4
  21. ** --------------
  22. ** created on Saturday, 19.02.94 01:27:31  by  Kai Iske.   LogMessage :
  23. **  -*-  changed on Thursday, 24.03.94 16:43:23  by  Kai Iske.   LogMessage :
  24. **   - EditEntry window`s cycle gadgets (IconPos, UseIcon etc..)
  25. **     are volume type senstive now, ie Ignore,Use,Inherit will be
  26. **     available when Type is set to "Volume",  while Ignore and
  27. **     Use are available when editing a device.
  28. **     (Suggested by : Christopher A. Wichura)
  29. **  -*-  changed on Wednesday, 23.03.94 12:49:17  by  Kai Iske.   LogMessage :
  30. **   - Inheritance of device settings is individually controlled
  31. **     for every entry through a cycle gadget, so that you may
  32. **     tell which items to inherit and which to ignore, or use.
  33. **     (Requested by : Christopher A. Wichura)
  34. **  -*-  changed on Tuesday, 22.03.94 23:19:46  by  Kai Iske.   LogMessage :
  35. **   - You may now force Window size/position and flags
  36. **     (display flags)
  37. **     (Requested by : Christopher A. Wichura)
  38. **  -*-  changed on Tuesday, 22.03.94 18:32:58  by  Kai Iske.   LogMessage :
  39. **   - The ListViews will show volumes in white color now, so
  40. **     that you may distinguish whether an entry is a Volume or a
  41. **     Device
  42. **  -*-  changed on Saturday, 19.03.94 17:58:56  by  Kai Iske.   LogMessage :
  43. **   - Diskobject for Iconify Gadget will obtained from the
  44. **     program`s icon
  45. **  -*-  changed on Saturday, 19.03.94 17:52:54  by  Kai Iske.   LogMessage :
  46. **   - Added online-help support
  47. **  -*-  changed on Saturday, 19.03.94 17:17:15  by  Kai Iske.   LogMessage :
  48. **   - Made behaviour of obtaining settings from a device entry
  49. **     for a volume entry switchable from ToolTypes/commandline
  50. **     options.
  51. **  -*-  changed on Saturday, 19.03.94 16:24:58  by  Kai Iske.   LogMessage :
  52. **   - ForceIcon will use memory pools for allocations now.
  53. **  -*-  changed on Saturday, 19.03.94 16:23:41  by  Kai Iske.   LogMessage :
  54. **   - For volumes, for which some flags aren`t set (like IconPos or
  55. **     UseIcon) ForceIcon will take the settings of the device
  56. **     the volume resides in as long as it is a) defined and b)
  57. **     the missing flag is set there.
  58. **     (Suggested by : Christopher A. Wichura)
  59. **  -*-  changed on Saturday, 19.03.94 15:43:18  by  Kai Iske.   LogMessage :
  60. **   - DiskChanges on startup protected by Semaphore
  61. **     (Suggested by: Christopher A. Wichura)
  62. **  -*-  changed on Saturday, 19.03.94 15:42:06  by  Kai Iske.   LogMessage :
  63. **   - LoadPrefs() protected by Semaphore
  64. **     (Suggested by: Christopher A. Wichura)
  65. **  -*-  changed on Thursday, 17.03.94 18:24:44  by  Kai Iske.   LogMessage :
  66. **   - If you quit the EditEntry window using "OK", ForceIcon_Prefs
  67. **     will send a disk change to the device in question...
  68. **   - Improved semaphore locking mechanism. Chris didn`t like it,
  69. **     so I changed it, even though I can`t see his point (for now)
  70. **     (Requested by : Christopher A. Wichura)
  71. **  -*-  changed on Wednesday, 16.03.94 22:23:30  by  Kai Iske.   LogMessage :
  72. **   - Added FlushMemory switch/tooltype
  73. **   - Only devices in the list (or their volumes) will get a 
  74. **     disk change on startup now
  75. **     (Requested by : Christopher A. Wichura)
  76. **  -*-  changed on Wednesday, 16.03.94 22:22:13  by  Kai Iske.   LogMessage :
  77. **   - Added server prefs concept. ForceIcon is a simple program
  78. **     now, w/o any GUI. A seperate Prefs Editor has been added
  79. **     (using MUI) to configure ForceIcon.
  80. **   - Rearrangement of List after editing an entry didn`t work
  81. **  -*-  changed on Saturday, 12.03.94 19:32:33  by  Kai Iske.   LogMessage :
  82. **   - Again changed the routine for getting the list of available
  83. **     volumes/devices
  84. **     (Suggestions by : Ralph Babel)
  85. **  -*-  changed on Saturday, 12.03.94 19:31:48  by  Kai Iske.   LogMessage :
  86. **   - Didn`t convert a string to upper-case before calling
  87. **     ParsePatternNoCase(). This has to be done for OS 37
  88. **     Systems.
  89. **     (Reported by : Christopher A. Wichura)
  90. **  -*-  changed on Saturday, 12.03.94 14:23:12  by  Kai Iske.   LogMessage :
  91. **   - Added special code to check for block mounted devices.
  92. **     (Supplied by : Christopher A. Wichura. Thanks Chris)
  93. **  -*-  changed on Thursday, 10.03.94 14:23:11  by  Kai Iske.   LogMessage :
  94. **   - When adding a new item to the list, another entry could
  95. **     loose the settings for the IconPos gadget. This was due to a
  96. **     bug in the sorting routine. Fixed
  97. **     (Reported by : Mark 'TheMug' Rose)
  98. **  -*-  changed on Thursday, 10.03.94 14:02:35  by  Kai Iske.   LogMessage :
  99. **   - Patterns for Volumes and Devices supported now
  100. **  -*-  changed on Sunday, 06.03.94 17:38:53  by  Kai Iske.   LogMessage :
  101. **   - When launched ForceIcon will now make all connected disks
  102. **     disk change, in order to reposition the icons. This way you
  103. **     may launch ForceIcon from within your WBStartUp now
  104. **     (Requested by : Henning Schmiedehausen)
  105. **  -*-  changed on Sunday, 06.03.94 17:20:31  by  Kai Iske.   LogMessage :
  106. **   - Enforcer Hit for illegal Locks fixed
  107. **     (Changed by : Henning Schmiedehausen)
  108. **   - Windows will pop up on default PubScreen now
  109. **     (Changed by : Henning Schmiedehausen)
  110. **  -*-  changed on Sunday, 27.02.94 17:52:56  by  Kai Iske.   LogMessage :
  111. **   - More security checks when removing patches
  112. **     (Requested/Changed by : Henning Schmiedehausen)
  113. **  -*-  created on Saturday, 19.02.94 01:27:31  by  Kai Iske.   LogMessage :
  114. **   - ForceIcon didn`t clone all of the window`s flags
  115. **   - For some icon-substitutes, ForceIcon didn`t clone anything
  116. **     (Reported by : Michael 'Mick' Hohmann)
  117. **
  118. ** Revision V1.3
  119. ** --------------
  120. ** created on Sunday, 02.01.94 15:31:32  by  Kai Iske.   LogMessage :
  121. **   - Code cleanup
  122. **   - Partial rewrite of docs
  123. **
  124. ** Revision V1.2
  125. ** --------------
  126. ** created on Tuesday, 07.12.93 18:10:09  by  Kai Iske.   LogMessage :
  127. **   - Entries may be copied now
  128. **
  129. ** Revision V1.1
  130. ** --------------
  131. ** created on Tuesday, 02.11.93 23:11:14  by  Kai Iske.   LogMessage :
  132. **  -*-  changed on Saturday, 27.11.93 02:12:59  by  Kai Iske.   LogMessage :
  133. **   - Recompiled using SAS 6.50
  134. **  -*-  changed on Saturday, 20.11.93 18:14:21  by  Kai Iske.   LogMessage :
  135. **   - ForceIcon will adopt the orig. window position and size now.
  136. **     (Suggested by : Michael 'Mick' Hohmann and me)
  137. **  -*-  changed on Saturday, 20.11.93 18:03:08  by  Kai Iske.   LogMessage :
  138. **   - Icons weren`t positions as set with the Position window.
  139. **     (Reported by : Michael 'Mick' Hohmann)
  140. **   - Misleading explanation removed from docs
  141. **     (Reported by : Michael 'Mick' Hohmann)
  142. **  -*-  changed on Saturday, 20.11.93 17:33:51  by  Kai Iske.   LogMessage :
  143. **   - The X/Y coordinates may be set manually, now.
  144. **     (Requested by : Michael 'Mick' Hohmann)
  145. **  -*-  changed on Saturday, 20.11.93 17:24:20  by  Kai Iske.   LogMessage :
  146. **   - Edit Entry window`s gadget used 'I' twice
  147. **     (Reported by : Michael 'Mick' Hohmann)
  148. **  -*-  changed on Thursday, 11.11.93 18:43:27  by  Kai Iske.   LogMessage :
  149. **   - You may now tell ForceIcon not to patch the position, but
  150. **     rather let WB chose a good place. (Good when importing
  151. **     volumes via network)
  152. **  -*-  changed on Tuesday, 02.11.93 23:23:00  by  Kai Iske.   LogMessage :
  153. **   - ListView gadgets weren`t adjusted for OS 2.x. - Should check
  154. **     for OS 2.x sometime ;)
  155. **     (Reported by : Bernhard Moellemann)
  156. **   - Changed needed Versions of some libraries from 37 to 36
  157. **  -*-  created on Tuesday, 02.11.93 23:11:14  by  Kai Iske.   LogMessage :
  158. **   - If there wasn`t a filename for the Icon-File the
  159. **     FileRequester sometimes showed a weird Drawer-Name
  160. **     (Reported by : Dirk Federlein)
  161. **
  162. ** Revision V1.0
  163. ** --------------
  164. ** created on Wednesday, 20.10.93 17:19:27  by  Kai Iske.   LogMessage :
  165. **  -*-  changed on Thursday, 28.10.93 17:35:28  by  Kai Iske.   LogMessage :
  166. **   - Suggestions for device dependancy by Ralph Babel
  167. **   - Bug "found" by Ralph Babel
  168. **   - Pos window used to open on default pubscreen, not on WB.
  169. **     (Reported by : Bernhard Moellemann)
  170. **  -*-  created on Wednesday, 20.10.93 17:19:27  by  Kai Iske.   LogMessage :
  171. **     --- Initial release ---
  172. **
  173. *********************************************************************************/
  174. #define REVISION "1.4"
  175. #define REVDATE  "24.03.94"
  176. #define REVTIME  "16:43:23"
  177. #define AUTHOR   "Kai Iske"
  178. #define VERNUM   1
  179. #define REVNUM   4
  180.  
  181.  
  182. /**********************************************************************/
  183. /*                   Prototype for serial debugging                   */
  184. /**********************************************************************/
  185. void KPrintF(char *, ...);
  186.  
  187.  
  188.  
  189. /**********************************************************************/
  190. /*                   Prototypes for Pool functions                    */
  191. /**********************************************************************/
  192. APTR    __asm AsmCreatePool(register __d0 ULONG, register __d1 ULONG, register __d2 ULONG, register __a6 struct ExecBase *);
  193. void    __asm AsmDeletePool(register __a0 APTR, register __a6 struct ExecBase *);
  194. APTR    __asm AsmAllocPooled(register __a0 APTR, register __d0 ULONG, register __a6 struct ExecBase *);
  195. void    __asm AsmFreePooled(register __a0 APTR, register __a1 APTR, register __d0 ULONG, register __a6 struct ExecBase *);
  196.  
  197.  
  198.  
  199. /**********************************************************************/
  200. /*                              Defines                               */
  201. /**********************************************************************/
  202. enum{
  203.     ERR_OPEN,
  204.     ERR_NOMEM,
  205.     ERR_NOTALL,
  206.     ERR_ABOUT,
  207.     ERR_EXISTS,
  208.     ERR_NONEG,
  209.     ERR_PATCHES,
  210.     ERR_PATCH,
  211.     ERR_NO_RELAUNCH,
  212.     ERR_NO_APP
  213. };
  214.  
  215.  
  216.  
  217. /**********************************************************************/
  218. /*                        Nodes for Guide file                        */
  219. /**********************************************************************/
  220. #define    NODE_MAIN        "Usage"
  221. #define    NODE_LEFT        "Left part"
  222. #define    NODE_RIGHT        "Right part"
  223. #define    NODE_EDIT        "EditEntry"
  224. #define    NODE_MANUAL        "ManualInput"
  225.  
  226.  
  227.  
  228. /**********************************************************************/
  229. /*                    This is our rendezvous Port                     */
  230. /**********************************************************************/
  231. struct FIconSema
  232. {
  233.     struct    SignalSemaphore    FIconSema;        // Our semaphore
  234.  
  235.     ULONG            UseCount;        // Use count of semaphore
  236.     char    Name[44];                // Name of semaphore
  237.  
  238.     struct    List        VolumeList;        // List of volumes
  239.     struct    Task        *ServerTask;        // Address of ServerTask
  240.  
  241.     APTR            FIconPool;        // Pool for allocations
  242.  
  243.     UWORD            FlushMemory;        // Flushmemory ???
  244.     UWORD            ObtainFromDev;        // Get settings from device when not set for volume ???
  245. };
  246.  
  247.  
  248.  
  249.  
  250.  
  251. /**********************************************************************/
  252. /*                         Structure defines                          */
  253. /**********************************************************************/
  254. struct VolEntry
  255. {
  256.     struct    Node    Link;
  257.     char        VolName[130];
  258.     char        IconName[256];
  259.     UWORD        Left;
  260.     UWORD        Top;
  261.     UWORD        UseAlt;
  262.     UWORD        IconPos;
  263.     UWORD        UseWin;
  264.     WORD        WinX;
  265.     WORD        WinY;
  266.     WORD        WinWidth;
  267.     WORD        WinHeight;
  268.     UWORD        UseFlags;
  269.     UWORD        WinFlags;
  270.     UWORD        Pad[25];        // For future expansions
  271.     WORD        LeftEdge;        // These are only used during runtime
  272.     WORD        TopEdge;
  273.     WORD        Width;
  274.     WORD        Height;
  275.     LONG        CurrentX;
  276.     LONG        CurrentY;
  277.     ULONG        Flags;
  278.     UWORD        ViewMode;
  279.     struct    MsgPort    *DriverTask;
  280. };
  281.  
  282.  
  283.  
  284. /**********************************************************************/
  285. /*                     Definitions for MainWindow                     */
  286. /**********************************************************************/
  287. enum {
  288.     ID_DUMMY,
  289.  
  290.     ID_USEDLIST,            // Main window
  291.     ID_EDITENTRY,
  292.     ID_COPYENTRY,
  293.     ID_REMOVEENTRY,
  294.     ID_AVAILLIST,
  295.     ID_ADDENTRY,
  296.     ID_ADDENTRYMAN,
  297.     ID_RESCANLIST,
  298.     ID_SAVE,
  299.     ID_USE,
  300.     ID_ABOUT,
  301.     ID_HIDE,
  302.     ID_QUIT,
  303.  
  304.     ID_EDITOK,            // Edit window
  305.     ID_EDITCANCEL,
  306.     ID_POSITION,
  307.     ID_DRAWER,
  308.  
  309.     ID_MANOK,            // Man window
  310.     ID_MANCANCEL
  311. };
  312.  
  313.  
  314.  
  315.  
  316. /**********************************************************************/
  317. /*                         Modes for settings                         */
  318. /**********************************************************************/
  319. enum {
  320.     MODE_IGNORE,
  321.     MODE_USE,
  322.     MODE_INHERIT
  323. };
  324.